package com.tqk.taxismart;

import com.tqk.constant.Constant;
import com.tqk.taxismart.distance.DistanceActivity;
import com.tqk.taxismart.list.ListTaxi;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity implements OnClickListener {
	
	private String TAG = "MainActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		findViewById(R.id.btnListTaxi_id).setOnClickListener(this);
		findViewById(R.id.btnEstimate_id).setOnClickListener(this);
		
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
	getMenuInflater().inflate(R.menu.main, menu);
	return true;
    }

    @Override
    public void onClick(View view) {
	int id = view.getId();
	switch (id) {
		case R.id.btnListTaxi_id:
			Log.i(TAG, "----> "+ Constant.readFileJson(getApplicationContext(), "data/list_taxi.json"));
			Intent i = new Intent(getApplicationContext(), ListTaxi.class);
			startActivity(i);
			finish();
	    break;
        case R.id.btnEstimate_id:
        	Intent intentDts = new Intent(getApplicationContext(), DistanceActivity.class);
    		startActivity(intentDts);
    		
        break;
        case R.id.btnTaxiNearby_id:
            
        break;
        case R.id.btnUserTaxi_id:
            
        break;
	default:
	    break;
	}
    }

}
